package com.eascs.admin.o2o.cacle.service;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.dubbo.config.annotation.Service;
import com.eascs.admin.o2o.back.entity.O2oBackEntity;
import com.eascs.admin.o2o.cacle.entity.O2oCacleFlowEntity;
import com.eascs.admin.o2o.loan.service.O2oLoanapplyService;
import com.eascs.admin.o2o.o2ozx.dao.O2oZxDao;
import com.eascs.admin.o2o.zx.vo.O2oZxVo;
import com.eascs.app.dao.PageResult;
import com.eascs.crm.common.custnew.service.CustomerService;
import com.eascs.workflow.common.service.sequence.SequenceService;

@Service
public class O2oCacleFlowServiceImpl implements IO2oCacleFlowService{
	
	@Reference
	CustomerService customerService;
	
	@Autowired
	O2oZxDao o2oZxDao;
	
	@Autowired
	private O2oLoanapplyService o2oloanapplyService;
	
	@Reference
	private SequenceService sequenceService;

	@Override
	public int add(O2oCacleFlowEntity arg0) {
		// TODO Auto-generated method stub
		return o2oZxDao.insert(arg0);
	}

	@Override
	public O2oCacleFlowEntity getEntityById(String id) {
		
		return o2oZxDao.getById(O2oCacleFlowEntity.class, id);
	}
	
	@Override
	public int update(O2oCacleFlowEntity arg0) {
		
		return o2oZxDao.updateById(arg0);
	}

	@Override
	public O2oCacleFlowEntity getEntityByLoanApplyNo(String loanapplyNo) {
		String sql = "select * from o2o_cacle where loanapply_no = ? ";
		return o2oZxDao.findEntity(sql, O2oCacleFlowEntity.class, loanapplyNo);
	}
	

}
